#define  _CRT_SECURE_NO_WARNINGS
class Solution {
public:
    int missingNumber(vector<int>& nums) {
        int i = 0, ret = 0;
        for (i = 0; i < nums.size(); i++) ret ^= nums[i] ^ i;
        return ret ^ i;
    }
};